#include "ofxAnimatedSprite.h"

ofxAnimatedSprite::ofxAnimatedSprite(){
}

void ofxAnimatedSprite::setup(){

}

void ofxAnimatedSprite::loadImage(string filename) {
    ofImage img;
    img.loadImage(filename);
    frames.push_back(img);
}

void ofxAnimatedSprite::update(){
    playHead+=playSpeed;
    if (playHead>=frames.size()) {
        playHead=0;
    }
}

void ofxAnimatedSprite::draw(int x, int y){
    frames[(int)playHead].draw(x,y);
}
